With development of the network, the transmission mode of shared medium becomes the mainstream of the network. The service level of one connection may be defined from three aspects, i.e., an effectiveness of connection, a time delay of connection, and a bandwidth of connection. The three aspects decide the quality of service. The traffic management system plays an important role in the aspect of controlling the time delay and the bandwidth of the connection, thereby affecting the quality of service (QoS) of the connection. One important method for ensuring the quality of service is performing traffic management by the traffic management system. The functions of the traffic management system mainly include: classification, traffic supervision, traffic shaping, scheduling, and statistics. The traffic shaping means forwarding data packets at a preset rate so as to follow a protocol with downstream devices, smooth traffic output, and reduce downstream congestion. During the traffic shaping, adding tokens for a mass of different data streams is a key factor for affecting the effect of the traffic shaping.
At present, a WFQ (Weighted Fair Queuing) method is generally utilized for traffic shaping. This method is particularly performed by: setting one weight corresponding to one maximum rate, converting a shaping rate configured for each data stream into a corresponding weight, and distributing the remained weight to one idle stream so as to occupy the remained bandwidth. However, when using the above WFQ method to add tokens for a mass of data streams having the same relatively small rate, there is a situation in which the tokens are intensively added into the idle stream and no data steam acquires the token during a period of time. In addition, the WFQ method can only allocate the bandwidth proportionally. When a sum of rates for shaping the data steam is greater than the set maximum weight, there is no idle stream. In this case, the data steam can only acquire the tokens according to the weight proportion, and thus the number of tokens which may be acquired by each data steam cannot reach the number deserved by the configured weight.